import request from '@/utils/index.js'

//获取经纪列表
export function getEconomicslist(params) {
    return request({
        url: '/agents',
        params
    })
}

//获取经济数量
export function getEconomicslistCount(params) {
    return request({
        url: '/agents/count',
        params
    })
}

//新建经济 
export function addEconomics(data) {
    return request({
        url: '/agents',
        method: 'post',
        data
    })

}
//获取指定经纪
export function getEconomics(id) {
    return request({
        url: `/agents/${id}`
    })
}

//编辑经纪
export function editEconomics(data) {
    return request({
        url: `/agents/${data.id}`,
        method: 'put',
        data
    })
}

//删除经纪
export function delEconomics(id) {
    return request({
        url: `/agents/${id}`,
        method: 'delete'
    })
}